<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>主页</title>
        <link rel="stylesheet" type="text/css" href="assets/lib/layui/css/layui.css" />
        <link rel="stylesheet" type="text/css" href="assets/css/index.css" />
    </head>
    <body>
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header header header-demo" spring>
                <div class="layui-main">
                    <a class="logo" href="/">
                        <img src="./assets/images/logo.png">
                    </a>
                    <div class="layui-form component" lay-filter="LAY-site-header-component"></div>
                    <ul class="layui-nav" id="topnav" class="right">

                        <li class="layui-nav-item" style="padding: 0;">
                            <img id="user_pic" src="">
                        </li>
                        <li class="layui-nav-item">
                            <a href="" id="username">欢迎您张三</a>
                            <dl class="layui-nav-child">
                                <dd><a href="edit.html" target="main_frame">修改信息</a></dd>
                                <dd><a href="hedpic.html" target="main_frame">更换头像</a></dd>
                                <dd><a href="editpassword.html" target="main_frame">重置密码</a></dd>
                            </dl>
                        </li>

                        <li class="layui-nav-item" style="cursor: pointer;" id="exit">
                            <span class="iconfont">&#xe865;</span>
                            <span>退出</span>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">

                    <ul class="layui-nav layui-nav-tree" lay-filter="test">
                        <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                        <li class="layui-nav-item layui-nav-itemed">
                            <a href="index.html"><span class="iconfont">&#xe6a9;</span>首页</a>

                        </li>
                        <li class="layui-nav-item sub">
                            <a href="javascript:;"><span class="iconfont">&#xe615;</span>文章管理</a>
                            <dl class="layui-nav-child">
                                <dd><a href="articleclass.html" target="main_frame">文章类别</a></dd>
                                <dd><a href="articles.html" target="main_frame">文章列表</a></dd>
                                <dd><a href="articlepub.html" target="main_frame">发表文章</a></dd>
                            </dl>
                        </li>
                        <li class="layui-nav-item sub">
                            <a href="javascript:;"><span class="iconfont">&#xe615;</span>个人中心</a>
                            <dl class="layui-nav-child">
                                <dd><a href="edit.html" target="main_frame">基本资料</a></dd>
                                <dd><a href="hedpic.html" target="main_frame">更换头像</a></dd>
                                <dd><a href="editpassword.html" target="main_frame">重置密码</a></dd>
                            </dl>
                        </li>

                    </ul>


                </div>
            </div>

            <div class="layui-body">
                <iframe src="home/dashboard.html" frameborder='0' name="main_frame"></iframe>
            </div>
            <script type="text/javascript" src="assets/lib/layui/layui.js">

            </script>
            <script src="assets/js/baseUrl.js"></script>
            <script type="text/javascript" src="assets/js/index.js">

            </script>
            <script>
                layui.use(['layer', 'jquery', 'form'], function() {
                    let layer = layui.layer;
                    let $ = layui.jquery;
                    $('#exit').click(function() {
                        layer.confirm('是否退出？', {
                            icon: 3,
                            title: '提示'
                        }, function(index) {
                            //do something
                            location.href = 'login.html';
                            localStorage.removeItem('user');
                            localStorage.removeItem('token');
                            layer.close(index);
                        });
                    })
                })
            </script>
    </body>
</html>
